const path = require('path');
const pathResolve = pathUrl => path.join(__dirname, pathUrl)

module.exports = {
    hot: true,
    webpack: {
        alias: {
            "@": pathResolve("src"),
            "@assets": pathResolve("src/assets"),
            "@components": pathResolve("src/components"),
            "@utils": pathResolve("src/utils"),
            "@store": pathResolve("src/store"),
            "@hooks": pathResolve("src/hooks"),
            "@style": pathResolve("src/style"),
        }
    },
    // 插件配置
    plugins: [

    ],
    // 修改Babel配置
    babel: {
        // plugins: [
        //     ["import", {
        //         libraryName: "antd",
        //         libraryDirectory: "es",
        //         style: true
        //     }]
        // ]
    },
    // 修改esline配置
    eslint: {
        // enable: false
    },
    // 跨域配置
    devServer: {
        proxy: {
            "/v1_0": {
                target: "http://geek.itheima.net/v1_0",
                changeOrigin: true,
                pathRewrite: { "^/v1_0": "" }
            }
        }
    }
}